package models

import "blog_go/models/ctype"

// 登录信息表
type LoginDataModel struct {
	MODEL
	UserID    uint
	IP        string           `gorm:"size:20"`
	NickName  string           `gorm:"size:20"`
	Token     string           `gorm:"size:256"`
	Device    string           `gorm:"size:256"`
	Addr      string           `gorm:"size:64"`
	LoginType ctype.SignStatus `gorm:"type:int;size:4"` // `gorm:"size:type=smallint(6)"`这样才可以指定库类型 size:4 是tinyint(4)
	// 以下不是表结构
	UserModel UserModel `gorm:"foreignKey:UserID"`
}

func (LoginDataModel) TableName() string {
	return "login_data"
}
